import request from '@/utils/request'

const api_name = '/eduservice/live'
export default {
  //添加直播
  addLive(live) {
    return request({
      url: `${api_name}/addLive`,
      method: 'post',
      data: live,
    })
  },
  getLives() {
    return request({
      url: `${api_name}/getLives`,
      method: 'get',
    })
  },
  getLiveByCourseId(id) {
    return request({
      url: `${api_name}/getLiveByCourseId/${id}`,
      method: 'get',
    })
  },
  //开始直播
  startOnLine(id) {
    return request({
      url: `${api_name}/startOnLine/${id}`,
      method: 'get',
    })
  },
  //开始直播
  updataPublic(id) {
    return request({
      url: `${api_name}/updataPublic/${id}`,
      method: 'get',
    })
  },
  // 条件分页查询
  getPageList(page, limit, searchObj) {
    return request({
      url: `${api_name}/liveFrontPageList/${page}/${limit}`,
      method: 'post',
      data: searchObj
    })
  },
}
